Skip to content

DATAMONGO-181: Ensure Mongo is closed when MongoFactoryBean is destroyed #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

lpireyn
Copy link

@lpireyn lpireyn commented Mar 29, 2012

Issue DATAMONGO-181 was actually never resolved. This pull request is the fix.

@odrotbohm
Copy link
Member

Good catch but I think this needs some more investigation. Back in the days Thomas added the DisposableBean call to SimpleMongoDbFactory. Your suggested patch makes a lot of sense but I would like to clean up the behaviour in SimpleMongoDbFactory as must not call close to Mongo instances configured from the outside. Beyond that we should move the setup of the Mongo instance to an afterPropertiesSet() method inside MongoFactoryBean to improve symmetrie for bootstrap and shutdown of the factory class.

I'll include your patch into a fix I'll commit against the original JIRA ticket.

@odrotbohm
Copy link
Member

Fixed and deployed to both 1.0.x and 1.1.x branches. Thanks for the contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants